import { defineStore } from 'pinia';

const headersStore = defineStore('headers', {
  state: () => ({
    headers: new Map()
  }),
  getters: {
    get() {
      return this.headers;
    }
  },
  actions: {
    set(key, value) {
      this.headers.set(key, value);
    },
    delete(key) {
      this.headers.delete(key);
    },
    clear() {
      this.headers.clear();
    }
  }
});

export const useHeadersStore = () => {
  return headersStore();
};
